package com.dstz.bpm.api.engine.action.cmd;

import com.alibaba.fastjson.JSONObject;
import com.dstz.form.api.model.FormCategory;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.NotBlank;

@ApiModel(
   description = "流程实例、流程任务 ActionCmd 请求参数，请参考FlowRequestParam.java 或者文档了解 "
)
public class FlowRequestParam {
   @ApiModelProperty("流程定义id，流程启动等场景必须")
   private String defId;
   @ApiModelProperty("流程实例id，流程草稿等场景")
   private String instanceId;
   @ApiModelProperty("流程任务id，流程任务处理时必须")
   private String taskId;
   @NotBlank
   @ApiModelProperty("action name 必须")
   private String action;
   @ApiModelProperty("前端节点人员设置")
   private JSONObject nodeUsers;
   @ApiModelProperty("流程业务数据，JSON格式：{boCodeA:{},boCodeB:{}}")
   private JSONObject data;
   @ApiModelProperty("流程业务主键。 URL表单，可以直接赋值调用rest接口启动流程")
   private String businessKey;
   @ApiModelProperty("表单类型")
   private String formType;
   @ApiModelProperty("流程任务审批意见")
   private String opinion;
   @ApiModelProperty("目标节点")
   private String destination;
   @ApiModelProperty("特殊属性扩展配置：可以再 ActionCmd 中拿到此配置")
   private JSONObject extendConf;

   public FlowRequestParam(String taskId, String action, JSONObject data, String opinion) {
      this.formType = FormCategory.INNER.value();
      this.taskId = taskId;
      this.action = action;
      this.data = data;
      this.opinion = opinion;
   }

   public FlowRequestParam(String defId, String action, JSONObject data) {
      this.formType = FormCategory.INNER.value();
      this.defId = defId;
      this.action = action;
      this.data = data;
   }

   public FlowRequestParam() {
      this.formType = FormCategory.INNER.value();
   }

   public String getDefId() {
      return this.defId;
   }

   public void setDefId(String defId) {
      this.defId = defId;
   }

   public String getInstanceId() {
      return this.instanceId;
   }

   public void setInstanceId(String instanceId) {
      this.instanceId = instanceId;
   }

   public String getTaskId() {
      return this.taskId;
   }

   public void setTaskId(String taskId) {
      this.taskId = taskId;
   }

   public String getAction() {
      return this.action;
   }

   public void setAction(String action) {
      this.action = action;
   }

   public String getBusinessKey() {
      return this.businessKey;
   }

   public void setBusinessKey(String businessKey) {
      this.businessKey = businessKey;
   }

   public JSONObject getNodeUsers() {
      return this.nodeUsers;
   }

   public void setNodeUsers(JSONObject nodeUsers) {
      this.nodeUsers = nodeUsers;
   }

   public JSONObject getData() {
      return this.data;
   }

   public void setData(JSONObject data) {
      this.data = data;
   }

   public String getFormType() {
      return this.formType;
   }

   public void setFormType(String formType) {
      this.formType = formType;
   }

   public String getOpinion() {
      return this.opinion;
   }

   public void setOpinion(String opinion) {
      this.opinion = opinion;
   }

   public String getDestination() {
      return this.destination;
   }

   public void setDestination(String destination) {
      this.destination = destination;
   }

   public JSONObject getExtendConf() {
      return this.extendConf;
   }

   public void setExtendConf(JSONObject extendConf) {
      this.extendConf = extendConf;
   }
}
